<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Extract public key from certificate and prepare it for use</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-new.html">openssl_pkey_new</a></div>
 <div class="up"><a href="ref.openssl.html">OpenSSL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.openssl-pkey-get-public" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkey_get_public</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_public</span> &mdash; <span class="dc-title">Extract public key from certificate and prepare it for use</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-public-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">resource</span> <span class="methodname"><strong>openssl_pkey_get_public</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$certificate</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><a href="function.openssl-get-publickey.html" class="function">openssl_get_publickey()</a></span> extracts the public key from
   <em><code class="parameter">certificate</code></em> and prepares it for use by other
   functions.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-public-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">certificate</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">certificate</code></em> can be one of the following:
       <ol type="1">
        <li class="listitem"><span class="simpara">an X.509 certificate resource</span></li>
        <li class="listitem"><span class="simpara">a string having the format
          <var class="filename">file://path/to/file.pem</var>. The named file must
          contain a PEM encoded certificate/private key (it may contain both).
         </span>
        </li>
        <li class="listitem"><span class="simpara">A PEM formatted private key.</span></li>
       </ol>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-public-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a positive key resource identifier on success, or <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-new.html">openssl_pkey_new</a></div>
 <div class="up"><a href="ref.openssl.html">OpenSSL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
